﻿using iemtm.WeChat.Core;
using iemtm.WeChat.Core.Managers;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace iemtm.WeChat.Web.Entry.Areas.Admin.Controllers
{

    /// <summary>
    /// 支架
    /// </summary>
    [Area("Admin")]
    [Route("/[controller]/[action]")]
    public class BracketController : Controller
    {
        private readonly IGeneratorManager _generatorManager;
        public BracketController(IGeneratorManager generatorManager)
        {
            _generatorManager = generatorManager;

        }

        public IActionResult Index()
        {
            return View();
        }
        public ActionResult AddGenBracket(string dtuid)
        {
         
            Generator Gmodel = MemoryEntity.gBuffGen[dtuid];// GeneratorList.Frist(dtuId);
            ViewBag.DTUID = Gmodel.DTUID;
            ViewBag.GensetNum = Gmodel.GensetNum;
            //dtuid = "RJTX163218110554";
            //LoginInfo.PrjCode = "0113";


            return View();
        }

        /// <summary>
        /// 采集器维修明细
        /// </summary>
        /// <returns></returns>
        public async Task<ActionResult> Detail(string BracketCode)
        {
           var model= await _generatorManager.GetCollectorBracketAndPritureAsync(BracketCode);


            return View(model);
        }
    }
}
